package com.dc.entity.special;

import com.dc.entity.ShipRepairEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.*;
import java.util.Date;

/**
 *  2 船体焊接 亚善-康帝
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Entity
@Table(name = "t_workflow_special_1_ship_weld")
public class WorkflowSpecial1ShipWeldEntity {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    @Column(name = "ship_repair_id", columnDefinition = "bigint unsigned NOT NULL", insertable = false, updatable = false)
    private Long shipRepairId;      // 维修记录 外键id

    @Column(name = "submit_time")
    @JsonFormat(pattern = "yyyy-MM-dd")
    // 生成
    private Date submitTime;        // 填写日期

    @Column(name = "ship_name", length = 50)
    private String shipName;        // 船体名称

    @Column(name = "reporter", length = 20)
    private String reporter;        // 填报人

    //////////////////////////////////////////////////
    @Column(name = "weld_type", length = 20)
    private String weldType;        // 船体焊接/内场焊接

    @Column(name = "board_type", length = 20)
    private String boardType;       // 类型   外板/筋板/xxx

    @Column(name = "thick_ness")
    private Double thickness;       // 厚(mm)

    @Column(name = "width")
    private Double width;           // 宽(mm)

    @Column(name = "num")
    private Integer num;            // 数量

    @Column(name = "length")
    private Double length;          // 长(mm)

    @Column(name = "total_length")
    private Double totalLength;     // 焊接总长(mm)

    @Column(name = "co2_by_unit")
    private Double co2ByUnit;       // 单位耗二氧化碳标定值

    @Column(name = "co2")
    private Double co2;             // 二氧化碳

    @Column(name = "power_by_unit")
    private Double powerByUnit;     // 单位耗电量标定值

    @Column(name = "power")
    private Double power;           // 耗电量

    ////////////////////////////////////////////

    @JsonIgnore
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "ship_repair_id")
    private ShipRepairEntity shipRepairEntity;

}
